import React, { Component } from 'react';
import { connect } from 'dva';
import { Tooltip, Button, Card, Col, Row, Tabs, Icon, Tag, message, Select, } from 'antd';
import styles from './Users.css';
import moment from 'moment';
import Factory from '../factory';
import dataEditCreate from '../addons/DataEdit'
import dataTableCreate from '../addons/CustomDataTable'
import * as datetime from '../../utils/datetime'
import * as common from '../../utils/common';
import Draggable from 'react-draggable';
const daoName = "Cutom_WideTable_ZYHJ";
const ButtonGroup = Button.Group;
const TabPane = Tabs.TabPane;
const { CheckableTag } = Tag;

const LineTags = ['公司银行部', '交易银行部', '投资银行部', '同业票据部', '托管资产部', '普惠金融部', '零售银行部', '个人信贷部'];

const CompareTypeTags = ['比上月', '比上年同期'];

const ISSELECT = {
  "1": "合计",
  "2": "营销额度",
  "3": "产品绩效",
  "4": "全部"
}

const EditFrom = dataEditCreate(daoName);
const DataTable = dataTableCreate(daoName);
class CustomReportForm extends Component {
  // 构造函数，用于初始化state
  constructor(props) {
    super(props);
    this.state = {
      // 数据是否改变
      dataChange: false,
      // tab面板的key
      tabPaneKey: "1",
      // 测量标签
      MeasureTags: [],
      // 线选中标签
      LineSelectedTags: [],
      // 测量选中标签
      MeasureSelectedTags: [],
      // 比较类型选中标签
      CompareTypeSelectedTags: [],
      // 列
      columns: [],
      // 控件
      controls: [],

      inputValue: Number(new Date().getFullYear())
    };
  }
  // 组件挂载时调用
  componentDidMount() {
    // 设置permID
    const permID = 707
    // 调用dispatch函数，设置keyName和permID
    this.props.dispatch({
      type: `${daoName}/setKeyName`,
      payload: { keyName: "ID", permID: this.props.permID }
    });
    this.props.dispatch({
      type: `CONF_Cutom_WideTable_MeasureTags/fetch`,
      payload: { daoName: "CONF_Cutom_WideTable_MeasureTags", page: 1, pageSize: 99999 }
    });
    this.props.dispatch({
      type: `CONF_Cutom_WideTable_COLGX/fetch`,
      payload: { daoName: "CONF_Cutom_WideTable_COLGX", page: 1, pageSize: 99999 }
    });
  }

  DimHandleChange(tag, checked) {
    let { LineSelectedTags, MeasureSelectedTags } = this.state;
    // 定义一个新的数组
    let newArr = []
    // 如果 checked 为 false
    if (!checked) {
      // 将 MeasureSelectedTags 中不包含 lineArr 的值添加到 newArr 中
      newArr = MeasureSelectedTags.filter(t => !lineArr.includes(t))
    }
    // 如果checked为true，则将tag添加到已选择标签中，否则从已选择标签中移除tag
    const nextSelectedTags = checked ? [...LineSelectedTags, tag] : LineSelectedTags.filter(t => t !== tag);
    // 更新状态中的已选择标签和测量标签
    this.setState({ LineSelectedTags: nextSelectedTags, MeasureSelectedTags: newArr });
  }
  // 修改MeasureHandleChange函数，添加中文注释
  MeasureHandleChange(tag, checked) {
    // 获取MeasureSelectedTags状态
    const { MeasureSelectedTags } = this.state;
    // 如果checked为true，则将tag添加到MeasureSelectedTags中，否则从MeasureSelectedTags中过滤掉tag
    const nextSelectedTags = checked ? [...MeasureSelectedTags, tag] : MeasureSelectedTags.filter(t => t !== tag);
    // 更新MeasureSelectedTags状态
    this.setState({ MeasureSelectedTags: nextSelectedTags });
  }
  // 比较类型处理更改函数，参数为tag和checked
  CompareTypeHandleChange(tag, checked) {
    // 获取当前状态中的比较类型已选择标签
    const { CompareTypeSelectedTags } = this.state;
    // 如果checked为true，则将tag添加到比较类型已选择标签中，否则从比较类型已选择标签中过滤掉tag
    const nextSelectedTags = checked ? [...CompareTypeSelectedTags, tag] : CompareTypeSelectedTags.filter(t => t !== tag);
    // 更新比较类型已选择标签状态
    this.setState({ CompareTypeSelectedTags: nextSelectedTags });
  }
  //重置函数
  reset() {
    this.setState({ LineSelectedTags: [], MeasureTags: [], MeasureSelectedTags: [], CompareTypeSelectedTags: [] });
  }
  // 清除状态
  clear(key) {
    if (key === "1") {
      // 设置维度标签为空数组
      this.setState({ LineSelectedTags: [], MeasureTags: [], MeasureSelectedTags: [] });
    } else if (key === "2") {
      // 设置度量标签为空数组
      this.setState({ MeasureSelectedTags: [] });
    } else if (key === "3") {
      // 设置比较类型标签为空数组
      this.setState({ CompareTypeSelectedTags: [] });
    }
  }
  tabsOnChange(key) {
    const { MeasureTags_gsyhb, MeasureTags_jyyhb, MeasureTags_tzyhb, MeasureTags_typjb, MeasureTags_tgzcb,
      MeasureTags_phjrb, MeasureTags_lsyhb, MeasureTags_grxdb } = this.props
    let { LineSelectedTags, MeasureTags, inputValue } = this.state;
    MeasureTags = []
    if (key === "2" && LineSelectedTags.length > 0) {
      LineSelectedTags.map((v, i) => {
        if (v === "公司银行部") {
          let lineArr = MeasureTags_gsyhb.filter((t) => { return t.NF === inputValue })
          MeasureTags = [...MeasureTags, ...lineArr.map((t, i) => { return t.ZBMC })]
          console.log(MeasureTags_gsyhb, lineArr, MeasureTags);
        } else if (v === "交易银行部") {
          let lineArr = MeasureTags_jyyhb.filter((t) => { return t.NF === inputValue })
          MeasureTags = [...MeasureTags, ...lineArr.map((t, i) => { return t.ZBMC })]
        } else if (v === "投资银行部") {
          let lineArr = MeasureTags_tzyhb.filter((t) => { return t.NF === inputValue })
          MeasureTags = [...MeasureTags, ...lineArr.map((t, i) => { return t.ZBMC })]
        } else if (v === "同业票据部") {
          let lineArr = MeasureTags_typjb.filter((t) => { return t.NF === inputValue })
          MeasureTags = [...MeasureTags, ...lineArr.map((t, i) => { return t.ZBMC })]
        } else if (v === "托管资产部") {
          let lineArr = MeasureTags_tgzcb.filter((t) => { return t.NF === inputValue })
          MeasureTags = [...MeasureTags, ...lineArr.map((t, i) => { return t.ZBMC })]
        } else if (v === "普惠金融部") {
          let lineArr = MeasureTags_phjrb.filter((t) => { return t.NF === inputValue })
          MeasureTags = [...MeasureTags, ...lineArr.map((t, i) => { return t.ZBMC })]
        } else if (v === "零售银行部") {
          let lineArr = MeasureTags_lsyhb.filter((t) => { return t.NF === inputValue })
          MeasureTags = [...MeasureTags, ...lineArr.map((t, i) => { return t.ZBMC })]
        } else if (v === "个人信贷部") {
          let lineArr = MeasureTags_grxdb.filter((t) => { return t.NF === inputValue })
          MeasureTags = [...MeasureTags, ...lineArr.map((t, i) => { return t.ZBMC })]
        }
      })
    }
    // 设置tabPaneKey的值为key
    this.setState({ tabPaneKey: key, MeasureTags })
  }
  onChangeInput(e) {
    this.reset()
    this.setState({ inputValue: Number(e) })
    message.success("年份筛选完成。")
  }
  createData() {
    const DB_COLGX = this.props.list3.reduce((DB_COLGX, item) => ({ ...DB_COLGX, [item.ZDMC]: item.ZSMC }), {})
    const DB_DYGX = this.props.list3.reduce((DB_DYGX, item) => ({ ...DB_DYGX, [item.ZDMC]: item.DBMC }), {})
    // 获取表单中的数据
    let { LineSelectedTags, MeasureSelectedTags, CompareTypeSelectedTags, columns, controls } = this.state;
    let { ny, issel } = ''
    // 获取表单中的数据
    const form = this.refs.findForm.getForm();
    form.validateFields((err, values) => {
      if (!err) {
        // 如果YF为空，则设置YF为空字符串
        if (values.YF === undefined) {
          values.YF = ""
        }
        // 将YF转换为日期格式
        let value = new Date(values.YF)
        // 设置月份为当前月份加1
        value.setMonth(value.getMonth() + 1);
        // 设置日期为0
        value.setDate(0);
        // 将日期格式转换为yyyy-MM-dd格式
        let d = datetime.format(value, "yyyy-MM-dd")
        // 将日期转换为字符串，去掉'-'
        ny = String(d).replace("-", "").replace("-", "")
        // 如果ISSEL为空，则设置ISSEL为空字符串
        if (values.ISSEL === undefined) {
          values.ISSEL = ""
        }
        // 将ISSEL赋值给issel
        issel = values.ISSEL
      }
    });
    // 初始化columns和controls
    columns = []
    controls = []
    // 如果LineSelectedTags或MeasureSelectedTags的长度为0，则提示指标值不能为空，请选择指标值
    if (LineSelectedTags.length === 0 || MeasureSelectedTags.length === 0) {
      message.error("指标值不能为空，请选择指标值!")
      return
    }
    // 初始化colArr
    let colArr = [{
      title: "经营单位",
      name: "SSBM",
      type: "text"
    }]
    // 遍历MeasureSelectedTags，将指标值添加到colArr中
    MeasureSelectedTags.map((v, i) => {
      // 如果issel不等于4，则添加指标值到colArr中
      if (issel !== "4") {
        let d = {
          title: v,
          children: [
            {
              title: DB_COLGX[ISSELECT[issel] + "_" + v],
              name: DB_DYGX[ISSELECT[issel] + "_" + v],
              type: "number"
            }
          ]
        }
        colArr.push(d)
        // 如果CompareTypeSelectedTags的长度大于0，则遍历CompareTypeSelectedTags，将比较指标值添加到colArr中
        if (CompareTypeSelectedTags.length > 0) {
          CompareTypeSelectedTags.map((c, j) => {
            let data =
            {
              title: DB_COLGX[ISSELECT[issel] + "_" + v + "_" + c],
              name: DB_DYGX[ISSELECT[issel] + "_" + v + "_" + c],
              type: "number"
            }
            colArr[i + 1].children.push(data)
          })
        }
      } else {
        // 如果issel等于4，则添加指标值到colArr中
        let d = {
          title: v,
          children: [
            {
              title: DB_COLGX[ISSELECT["2"] + "_" + v],
              name: DB_DYGX[ISSELECT["2"] + "_" + v],
              type: "number"
            },
            {
              title: DB_COLGX[ISSELECT["3"] + "_" + v],
              name: DB_DYGX[ISSELECT["3"] + "_" + v],
              type: "number"
            },
            {
              title: DB_COLGX[ISSELECT["1"] + "_" + v],
              name: DB_DYGX[ISSELECT["1"] + "_" + v],
              type: "number"
            }
          ]
        }
        colArr.push(d)
        // 如果CompareTypeSelectedTags的长度大于0，则遍历CompareTypeSelectedTags，将比较指标值添加到colArr中
        if (CompareTypeSelectedTags.length > 0) {
          CompareTypeSelectedTags.map((c, j) => {
            let data =
            {
              title: DB_COLGX[ISSELECT["1"] + "_" + v + "_" + c],
              name: DB_DYGX[ISSELECT["1"] + "_" + v + "_" + c],
              type: "number"
            }
            colArr[i + 1].children.push(data)
          })
        }
      }
    })
    // 遍历colArr，将指标值添加到columns和controls中
    colArr.map((c, i) => {
      // 如果c.children为空，则添加指标值到columns和controls中
      if (!c.children) {
        let data_columns = {
          title: c.title,
          dataIndex: c.name,
          key: c.name,
          width: 150,
          sorter: true,
          dispaly: true,
          filter: true
        }
        columns.push(data_columns)
        let data_controls = {
          name: c.name,
          required: true,
          type: c.type,
          label: c.title,
          grid: "12 / 24",
          dataType: c.type === "text" ? "string" : c.type
        }
        controls.push(data_controls)
      } else {
        // 如果c.children不为空，则添加指标值到columns和controls中
        let data_columns = {
          title: c.title,
          children: [],
          dispaly: true
        }
        columns.push(data_columns)
        const chiArr = c.children
        chiArr.map((chi, j) => {
          let children_data_columns = {
            title: chi.title,
            dataIndex: chi.name,
            key: chi.name,
            width: 120,
            sorter: true,
            dispaly: true,
            filter: false,
            className: 'column-money',
            render: data => common.formatNumber(data),
          }
          columns[i].children.push(children_data_columns)
          let data_controls = {
            name: chi.name,
            required: true,
            type: chi.type,
            label: chi.title,
            grid: "12 / 24",
            dataType: chi.type === "text" ? "string" : c.type
          }
          controls.push(data_controls)
        })
      }
    });
    if (controls.length > 10) {
      columns[0].fixed = 'left'
    }
    // 设置state，更新columns和controls
    this.setState({ columns, controls })
    // 定义whereItems和WhereCauses
    let whereItems = [];
    let WhereCauses = [];
    // 将ny添加到whereItems中
    whereItems.push({
      FieldName: "DTID",
      Operator: "=",
      FieldValues: ny,
    });
    // 将whereItems添加到WhereCauses中
    WhereCauses.push({
      WhereItems: whereItems,
      RelationSign: "AND"
    })
    // 调用dispatch，传入daoName，page，pageSize和seeks
    this.props.dispatch({
      type: `${daoName}/fetch`,
      payload: { daoName, page: 1, pageSize: 20, seeks: WhereCauses }
    });
  }
  //导出数据
  exportData() {
    let ny = ''
    // 获取表单中的数据
    const findForm = this.refs.findForm.getForm();
    findForm.validateFields((err, values) => {
      if (!err) {
        // 如果YF为空，则设置YF为空字符串
        if (values.YF === undefined) {
          values.YF = ""
        }
        // 将YF转换为日期格式
        let value = new Date(values.YF)
        // 设置月份为当前月份加1
        value.setMonth(value.getMonth() + 1);
        // 设置日期为0
        value.setDate(0);
        // 将日期格式转换为yyyy-MM-dd格式
        let d = datetime.format(value, "yyyy-MM-dd")
        // 将日期转换为字符串，去掉'-'
        ny = String(d).replace("-", "").replace("-", "")
      }
    });
    let { columns } = this.state;
    //判断是否生成了数据
    if (columns.length <= 0) {
      message.error("请生成数据后，再进行导出!")
      return
    }
    //定义一个数组，用于存储表头信息
    let columnHeaders = []
    //遍历columns，将每一项的key、title、width添加到columnHeaders中
    const getColumns = (c, j, pch) => {
      // 判断c是否有子节点
      if (c.children) {
        // 创建一个对象，用于存储标题和子节点
        const h = { Caption: c.title, Children: [] }
        // 将标题和子节点添加到pch中
        pch.push(h)
        // 遍历子节点，递归调用getColumns函数
        c.children.map((ch, i) => {
          getColumns(ch, j, h.Children)
        })
      } else {
        // 获取标题
        const name = c.caption ? c.caption : c.dataIndex ? c.dataIndex : c.key
        // 如果没有标题，抛出错误
        if (!name) {
          throw new Error(`列"${c.title}"没有配置caption或dataIndex，请修改！`);
        }
        // 创建一个对象，用于存储标题、索引和宽度
        const header = {
          Name: name,
          Caption: c.title,
          Width: c.width
        }
        // 将标题、索引和宽度添加到pch中
        pch.push(header)
      }
    }
    // 遍历columns，调用getColumns函数
    columns.map((c, j) => {
      getColumns(c, j, columnHeaders)
    })
    //创建一个form表单，用于提交数据
    let form = document.createElement('form');//定义一个form表单
    const whereCauses = [{
      WhereItems: [{
        FieldName: "DTID",
        Operator: "=",
        FieldValues: ny
      }],
      RelationSign: "AND"
    }]
    const orderItems = []
    form.style = "display:none";
    form.target = "_blank";
    form.method = "post";
    form.action = "/api/ExportXlsx/" + daoName;
    //创建一个隐藏域，用于存储whereCauses
    let input1 = document.createElement("input");
    input1.type = "hidden";
    input1.name = "WhereCauses";
    input1.value = JSON.stringify(whereCauses);
    //创建一个隐藏域，用于存储orderItems
    let input2 = document.createElement("input");
    input2.type = "hidden";
    input2.name = "OrderItems";
    input2.value = JSON.stringify(orderItems)
    //创建一个隐藏域，用于存储columnHeaders
    let input3 = document.createElement("input");
    input3.type = "hidden";
    input3.name = "ColumnHeaders";
    input3.value = JSON.stringify(columnHeaders);
    //创建一个隐藏域，用于存储permID
    let input4 = document.createElement("input");
    input4.type = "hidden";
    input4.name = "PermID";
    input4.value = "" + this.props.permID;
    //创建一个隐藏域，用于存储userID
    let input5 = document.createElement("input");
    input5.type = "hidden";
    input5.name = "UserID";
    input5.value = "" + this.props.userID;
    document.body.appendChild(form);//将表单放置在web中
    form.appendChild(input1);
    form.appendChild(input2);
    form.appendChild(input3);
    form.appendChild(input4);
    form.appendChild(input5);
    form.submit();
    document.body.removeChild(form)
  }
  render() {
    const permID = 707
    const { LineSelectedTags, MeasureSelectedTags, CompareTypeSelectedTags, columns, controls, MeasureTags } = this.state;
    const controlsDivi2 = [
      { name: 'YF', required: true, type: 'month', label: '日期', grid: 4 / 24 },
      {
        name: 'ISSEL', required: true, type: 'select', label: '选择', grid: 4 / 24,
        data: [
          { value: '1', label: '资源合计' },
          { value: '2', label: '营销额度' },
          { value: '3', label: '产品绩效' },
          { value: '4', label: '全部' }
        ]
      },
      {
        name: 'BT', required: false, type: 'button-group',
        data: [
          { value: '1', label: '生成数据', onClick: this.createData.bind(this) },
          { value: '2', label: '导出EXCEL', onClick: this.exportData.bind(this) },
        ], grid: 4 / 24
      },
    ];
    const controls2 = [
      {
        name: 'NF', required: true, type: 'Search3', label: '年份', grid: 12 / 24,
        layout: { labelSpan: 10, wrapperSpan: 13 },
        onSearch: (value) => this.onChangeInput(value),
      },
      {
        name: 'BT', type: 'button-group',
        data: [
          { value: '1', label: '重置', onClick: this.reset.bind(this) },
        ], grid: 12 / 24
      },
    ];
    let date = moment(datetime.format(new Date(), "yyyy-MM-dd"));
    const year = new Date().getFullYear();
    return (
      <div className={styles.normal} style={{ background: '#fff', marginTop: -16, padding: '5px 5px' }}>
        <div>
          <div style={{ padding: '15px' }}>
            <Tabs defaultActiveKey="1" style={{ marginBottom: 30, height: '150px', overflowY: "scroll" }}
              tabBarExtraContent={
                // <Button.Group >
                //   {/* <Button type="danger" onClick={this.selectAll.bind(this)}>全选</Button> */}
                //   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                //   <Button type="danger" onClick={() => this.reset()}>重置</Button>
                // </Button.Group>
                <EditFrom ref="selectY" daoName={daoName} controls={controls2} record={{ NF: year }} clearItemMargin={true} />
              }
              onChange={(k) => this.tabsOnChange(k)}
            >
              <TabPane tab={<span><Icon type="bar-chart" />条线</span>} key="1">
                {LineTags.map((tag, i) => (
                  <Button type="dashed" style={{ textAlign: "center", marginLeft: 20, padding: 0 }} key={i}>
                    <CheckableTag
                      key={tag}
                      checked={LineSelectedTags.indexOf(tag) > -1}
                      onChange={checked => this.DimHandleChange(tag, checked)}
                      style={{ marginLeft: 5 }}
                    >
                      {tag}
                    </CheckableTag>
                  </Button>
                ))}
              </TabPane>
              <TabPane tab={<span><Icon type="bar-chart" />指标</span>} key="2">
                {MeasureTags.map((tag, i) => (
                  <Button type="dashed" style={{ textAlign: "center", marginLeft: 20, padding: 0 }} key={i}>
                    <CheckableTag
                      key={tag}
                      checked={MeasureSelectedTags.indexOf(tag) > -1}
                      onChange={checked => this.MeasureHandleChange(tag, checked)}
                      style={{ marginLeft: 5 }}
                    >
                      {tag}
                    </CheckableTag>
                  </Button>
                ))}
              </TabPane>
              <TabPane tab={<span><Icon type="paper-clip" />比较类型</span>} key="3">
                {CompareTypeTags.map((tag, i) => (
                  <Button type="dashed" style={{ textAlign: "center", marginLeft: 20, padding: 0 }} key={i}>
                    <CheckableTag
                      key={tag}
                      checked={CompareTypeSelectedTags.indexOf(tag) > -1}
                      onChange={checked => this.CompareTypeHandleChange(tag, checked)}
                      style={{ marginLeft: 5 }}
                    >
                      {tag}
                    </CheckableTag>
                  </Button>
                ))}
              </TabPane>
            </Tabs>
            <Row gutter={16}>
              <Col span={8}>
                <Card title="条线值" bordered={true} extra={
                  <Tooltip placement="top" title={"一键清空"}>
                    <Button type="primary" size="small" shape="circle" icon="delete" onClick={() => this.clear("1")} />
                  </Tooltip>
                } style={{ height: 250, overflowY: "scroll" }}>
                  {LineSelectedTags.map((t, i) => (
                    <Tag color="#108ee9" style={{ marginBottom: "10px" }} key={i}>{t}</Tag>
                  ))}
                </Card>
              </Col>
              <Col span={8}>
                <Card title="指标值" bordered={true} extra={
                  <Tooltip placement="top" title={"一键清空"}>
                    <Button type="primary" size="small" shape="circle" icon="delete" onClick={() => this.clear("2")} />
                  </Tooltip>
                } style={{ height: 250, overflowY: "scroll" }}>
                  {MeasureSelectedTags.map((t, i) => (
                    <Tag color="#108ee9" style={{ marginBottom: "10px" }} key={i}>{t}</Tag>
                  ))}
                </Card>
              </Col>
              <Col span={8}>
                <Card title="比较类型" bordered={true} extra={
                  <Tooltip placement="top" title={"一键清空"}>
                    <Button type="primary" size="small" shape="circle" icon="delete" onClick={() => this.clear("3")} />
                  </Tooltip>
                } style={{ height: 250, overflowY: "scroll" }}>
                  {CompareTypeSelectedTags.map((t, i) => (
                    <Tag color="#108ee9" style={{ marginBottom: "10px" }} key={i}>{t}</Tag>
                  ))}
                </Card>
              </Col>
            </Row>
            <div style={{ marginTop: "20px" }}>
              <EditFrom ref="findForm" daoName={daoName} controls={controlsDivi2} record={{ YF: date, ISSEL: "1" }} clearItemMargin={true} />
            </div>
            <div style={{ padding: '15px' }}>
              <DataTable ref="userTable" daoName={daoName} columns={columns} controls={controls} permID={permID} />
            </div>
          </div>
        </div>
      </div>
    )
  }
}

function mapStateToProps(state) {
  const { showEdit, record, selectedRowKeys, keyName, list } = state[daoName];
  const { userID, orgID, pOrgID, popedomTypes } = state.menus;
  const { list: list2, MeasureTags_gsyhb,
    MeasureTags_jyyhb,
    MeasureTags_tzyhb,
    MeasureTags_typjb,
    MeasureTags_tgzcb,
    MeasureTags_phjrb,
    MeasureTags_lsyhb,
    MeasureTags_grxdb } = state["CONF_Cutom_WideTable_MeasureTags"];
  const { list: list3 } = state["CONF_Cutom_WideTable_COLGX"];
  return {
    userID,
    orgID,
    pOrgID,
    popedomTypes,
    showEdit,
    selectedRowKeys,
    keyName,
    record,
    list,
    list2,
    MeasureTags_gsyhb,
    MeasureTags_jyyhb,
    MeasureTags_tzyhb,
    MeasureTags_typjb,
    MeasureTags_tgzcb,
    MeasureTags_phjrb,
    MeasureTags_lsyhb,
    MeasureTags_grxdb, list3
  }
}
CustomReportForm = connect(mapStateToProps)(CustomReportForm)
export default CustomReportForm;

let render = (props) => React.createElement(CustomReportForm, props);
let f = new Factory()
f.set("CustomReportForm", render)
